<template>
  <SkillModal v-if="visible" v-model:visible="visible" @save="handleSava" />
</template>
<script setup>
// import { ref } from 'vue'
import { createSkill } from '@/api/game'
import SkillModal from './skill-modal.vue'
import { useVModel } from '@vueuse/core'
import emitter from '@/utils/mitt'
import { Message } from '@arco-design/web-vue'
const props = defineProps(['visible'])
const emits = defineEmits(['update:visible'])
const visible = useVModel(props, 'visible', emits)

const handleSava = (data) => {
  createSkill(data).then((res) => {
    Message.success('添加技能成功')
    emitter.emit('addSkill', res)
  })
}
</script>
<style lang="less" scoped></style>
